<template>
	<view class="mine-wrap page-bg content-20">
		<view class="line-info-wrap" v-if="items.length > 0">
			<view class="line-info" v-for="item in items" :key='item.id' @click= "link('/pages/mine/helpDetail?id='+item.id)">
				<view class="line-info__title text-overflow">{{item.artTitle}}意请部署到web服务器使用，不支持本地file协议打开。不要使用资源管理器直接打开。</view>
				<view class="line-info__con link"></view>
			</view>
		</view>
		
		<view v-else class="desc no-info">暂时没有相关文章~</view>
	</view>
</template>

<script>
	import footerInfo from '../../components/footerInfo.vue'
	import common from '../../utils/common.js'
	import { api } from '../../utils/api.js'
	export default {
		data() {
			return {
				pageIndex: 1,
				pageSize: 10,
				totalCount: 0,
				items: [],
				id: '20c9138e-3dbb-4844-24b8-08d7ecaa08c4'
			}
		},
		onLoad() {
			this.pageSize = common.pageSize
			this.getItems()
		},
		methods: {
			link(url) {
				this.$link(url)
			},
			getItems() {
				let {pageIndex, pageSize, id} = this.$data
				api.artclePagesByType({id, pageIndex, pageSize},(res) => {
					 this.totalCount = res.totalCount
					 if(this.pageSize > res.totalCount) { this.text = '已经没有更多了~' }
					 this.items = [...this.items, ...res.items]
				}) 
			}
		},
		onReachBottom() {
			if(this.pageIndex * this.pageSize >= this.totalCount) {
				this.text = '已经没有更多了~'
			}else{
				this.pageIndex ++
				this.getItems()
			}
		},
		components:{
			footerInfo
		}
	}
</script>

<style scoped lang="less">
	@import url('../../app.less');

	
</style>
